<!DOCTYPE html>
<html lang="ch-cn" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>BEATIFUL SECRET</title>

    <link rel="stylesheet" th:href="@{/css/basic.css}">
    <link rel="stylesheet" th:href="@{/css/user.css}">
    <link rel="stylesheet" th:href="@{/css/product.css}">

</head>

<body>

<nav>

        <img th:src="@{/img/logo.png}" alt="" class="logo">

    <ul>
        <li><a th:href="@{/user}">用户信息</a></li>
        <li><a th:href="@{/product}">产品表</a></li>
        <li><a th:href="@{/save}">产品录入</a></li>
    </ul>
    <span><a th:href="@{/logout}">退出登录</a></span>
</nav>
    <div class="userContent advertisingContent">
        <table>
            <caption id="productCaption">产品表</caption>
            <thead>
                <tr>
                    <th>产品ID</th>
                    <th>产品名</th>
                    <th>成分组ID</th>
                    <th>分类ID</th>
                    <th>品牌ID</th>
                    <th>动作</th>
                </tr>
            </thead>
            <tbody>
                <tr th:each="product: ${products}">
                    <td th:text="${product?.productId}"></td>
                    <td th:text="${product?.productName}"></td>
                    <td th:text="${product?.detailedComposition?.compositionGroupId}"></td>
                    <td th:text="${product?.classification.classificationId}"></td>
                    <td th:text="${product?.brand.brandId}">dddd</td>
                    <td>
                        <form th:action="@{/products/save}" th:object="${product}" method="POST"}>
                            <button type="submit">删除</button>
                        </form>

                    </td>
                </tr>
            </tbody>
        </table>

        <table>
            <caption id="compositionCaption">成分表</caption>
            <thead>
                <tr>
                    <th>成分ID</th>
                    <th>成分</th>
                    <th>成分含量</th>
                </tr>
            </thead>
            <tbody>
                <tr th:each="composition: ${compositions}" >
<!--                    th:each="detailedComposition: ${detailedCompositions}"-->

                    <td th:text="${composition?.compositionId}"> </td>
                    <td th:text="${composition?.compositionName}"> </td>
                    <td th:text="${composition?.content}"> </td>
                </tr>
            </tbody>
        </table>

        <table>
            <caption id="brandCaption">品牌表</caption>
            <thead>
                <tr>
                    <th >品牌ID</th>
                    <th >品牌名</th>
                </tr>
            </thead>
            <tbody>
                <tr th:each="brand: ${brands}" >
                    <td th:text="${brand?.brandId}">aaa</td>
                    <td th:text="${brand?.brandName}">bbbb</td>
                </tr>
            </tbody>
        </table>

        <table>
            <caption id="classificationCaption">分类表</caption>
            <thead>
                <tr>
                    <th>分类ID</th>
                    <th>分类名</th>
                </tr>
            </thead>
            <tbody>
                <tr th:each="classification: ${classifications}" >
                    <td th:text="${classification?.classificationId}"></td>
                    <td th:text="${classification?.classificationName}"></td>
                </tr>
            </tbody>
        </table>
        <br>
        <br>
    </div>

<footer>
    <div class="footerMain">
        <span>版权所有 @ xxxx</span>
        <span>备案号: xxxxxxx</span>
        <span>官网: pinzi.vybfi.top</span>
        <span>关于我们</span>

    </div>
</footer>

</body>

</html>